//
//  MyButton.m
//  ShopDemo
//
//  Created by 飞扬的青春 on 2018/7/5.
//  Copyright © 2018年 飞扬的青春. All rights reserved.
//

#import "MyButton.h"

@implementation MyButton





-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        NSInteger widthDis = frame.size.height - 40*kJLXWidthScale;
        self.imageV = [UIImageView new];
        [self addSubview:self.imageV];
        self.imageV.sd_layout
        .centerXEqualToView(self)
        .topSpaceToView(self, 5*kJLXWidthScale)
        .widthIs(widthDis)
        .heightIs(widthDis);
        self.titlab = [UILabel new];
        self.titlab.font = [UIFont systemFontOfSize:15*kJLXWidthScale];
        self.titlab.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.titlab];
        self.titlab.sd_layout
        .topSpaceToView(self.imageV, 0)
        .leftSpaceToView(self, 0)
        .rightSpaceToView(self, 0)
        .heightIs(35*kJLXWidthScale);
        
    }
    return self;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
